package com.hdoit.kylin.web.experiment.modelconfig;

import com.hdoit.kylin.web.group.providers.PersonListProvider;
import com.hdoit.kylin.web.studentManager.providers.ProjectProvider;
import com.hdoit.kylin.web.user.modelconfig.StudentConfig;
import com.hdoit.kylin.web.user.provider.StudentProvider;
import com.tennetcn.component.attribute.DisplayNameAttribute;
import com.tennetcn.component.attribute.DropDownListAttribute;
import com.tennetcn.component.attribute.RequiredAttribute;
import com.tennetcn.component.attribute.base.ModelMetadataAttributeConfiguration;

public class ExperimentConfig extends ModelMetadataAttributeConfiguration{
	public ExperimentConfig(){
		this.setProperty("experimentName")
			.hasAttribute(new DisplayNameAttribute("实验名称"))
			.hasAttribute(new RequiredAttribute("实验名称为必填"));
		
		this.setProperty("projectId")
			.hasAttribute(new DisplayNameAttribute("所属项目"))
			.hasAttribute(new DropDownListAttribute(new ProjectProvider()));
		
		this.setProperty("experimentDate")
			.hasAttribute(new DisplayNameAttribute("实验时间"));
			
		this.setProperty("employeeId")
			.hasAttribute(new DisplayNameAttribute("负责人"))
			.hasAttribute(new DropDownListAttribute(new StudentProvider(StudentConfig.class.getName()),false));
		
		this.setProperty("experimentAddress")
		.hasAttribute(new DisplayNameAttribute("实验地点"));
		
		this.setProperty("employeeIds")
			.hasAttribute(new DisplayNameAttribute("实验参与人员"))
			.hasAttribute(new DropDownListAttribute(new PersonListProvider()));
		
		this.setProperty("experimentReportUUID")
			.hasAttribute(new DisplayNameAttribute("实验报告"));
		
		this.setProperty("experimentComment")
		.hasAttribute(new DisplayNameAttribute("实验描述"));
		
		this.setProperty("employeeName")
			.hasAttribute(new DisplayNameAttribute("负责人"));
		
		this.setProperty("experimentReportName")
			.hasAttribute(new DisplayNameAttribute("实验报告"));
	}
}
